package org.duoyi.striver.service.post;

import lombok.extern.slf4j.Slf4j;
import org.duoyi.striver.consts.Area;
import org.duoyi.striver.consts.Picture;
import org.duoyi.striver.service.Task;
import org.duoyi.striver.service.TaskPost;
import org.duoyi.striver.service.common.CommonService;

/**
 * 阵容选择
 */
@Slf4j
public class LineupPost extends TaskPost {

    private final int lineupIndex;

    public LineupPost(Task target, int lineupIndex) {
        super("阵容选择", target);
        this.lineupIndex = lineupIndex;
    }

    @Override
    public void doPost() {
        CommonService.closeAllPanel();
        if (!Picture.右下角菜单_长.find()) {
            Area.右下角菜单_切换.leftClick();
        }
        Area.右下角菜单_伙伴.leftClick();
        Area.伙伴界面_伙伴布阵.leftClick();
        log.info("选择阵容【{}】", lineupIndex);
        Area.valueOf("伙伴界面_阵容" + lineupIndex).leftClick();
        CommonService.closeAllPanel();
    }
}
